sortlistmodel: Make the sort callback useful
authorBenjamin Otte <otte@redhat.com>
Mon, 20 Jul 2020 23:40:06 +0000 (01:40 +0200)
committerBenjamin Otte <otte@redhat.com>
Wed, 22 Jul 2020 12:04:40 +0000 (14:04 +0200)
commit080e62509029418aa83bd4a5f8cd136c4df7ec94
tree5d289ef0440d0fe94210c1fdc5253e31b6d23e36
parent26696a741e6e1ccb4f50721336359af9267c196e
sortlistmodel: Make the sort callback useful

1. Run step() for a while to avoid very short steps
   This way, we batch items-changed() emissions.

2. Track the change region accurately
   This way, we can avoid invalidating the whole list if our step just
   touched a small part of a huge list.
   As this is a merge sort, this is a common occurence when we're buys
   merging chunks: The rest of the model outside those chunks isn't
   changed.

Note that the tracking is accurate: It determines the minimum change
region in the model.

This will be important, because the testsuite is going to test this.
gtk/gtksortlistmodel.c